stylecontext: Change fallback behavior on state mismatch
authorBenjamin Otte <otte@redhat.com>
Mon, 15 Jun 2015 02:30:50 +0000 (04:30 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 15 Jun 2015 02:36:47 +0000 (04:36 +0200)
commitfe51ac273c8045279a222c22a52d297d5ede4169
tree24962ed0141f179e327b5e0681772753f358a273
parentfa29a01c26e078b0ef486c1083e41ed7a0c1536e
stylecontext: Change fallback behavior on state mismatch

For functions that take state flags as an argument we need to special
case the situation where the passed in flags don't match the current
state.

Previously we would create a copy of the style info, change its state
and do the lookup from there.

Now that GtkCssNode has replaced style infos, this doesn't work as well
anymore as copying a GtkCssNode is not possible.
However, unike style infos, GtkCssNodes are instant-apply, so we don't
need to copy anymore, we can just change the state of the node.

This causes some invalidations to be queued, but we can take that
performance hit as this is fallback code.

https://bugzilla.redhat.com/show_bug.cgi?id=1228852
gtk/gtkstylecontext.c